#include "undigraph.h"

void printgraph(undigraph &graph, int n)
{
    for(int i = 0; i < n; i++)
    {
        for(int index : graph.adjList[i])
        {
            cout << "(" << i << ", " << index << ")";
        }
        cout << endl;
    }
}

int main(int argc, char*argv[])
{
    vector<Edge> edges = 
    {
        {0, 1}, {0, 2}, {1, 2}, {1, 3}
    };

    undigraph graph(edges, 4);
    printgraph(graph, 4);

    cout << "The length of the shortest path between (0,1) is " 
    << graph.shortestpath(0, 1) << endl;
    cout << "The length of the shortest path between (0,2) is " 
    << graph.shortestpath(0, 2) << endl;
    cout << "The length of the shortest path between (0,3) is " 
    << graph.shortestpath(0, 3) << endl;
    cout << "The length of the shortest path between (2,3) is " 
    << graph.shortestpath(2, 3) << endl;

    return 0;
}